using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class WaybillTakeSendInfoMap : EntityTypeConfiguration<WaybillTakeSendInfo>
	{
		public WaybillTakeSendInfoMap()
		{
			// Primary Key
			this.HasKey(t => t.WaybillNO);

			// Properties
			this.Property(t => t.WaybillTakeSendID)
				.HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
				
			this.Property(t => t.SendBy)
				.HasMaxLength(50);
				
			this.Property(t => t.SendAddress)
				.HasMaxLength(100);
				
			this.Property(t => t.SendPost)
				.HasMaxLength(15);
				
			this.Property(t => t.SendTel)
				.HasMaxLength(30);
				
			this.Property(t => t.SendEmail)
				.HasMaxLength(50);
				
			this.Property(t => t.SendMobile)
				.HasMaxLength(15);
				
			this.Property(t => t.SendFax)
				.HasMaxLength(30);
				
			this.Property(t => t.SendProvince)
				.HasMaxLength(50);
				
			this.Property(t => t.SendCity)
				.HasMaxLength(50);
				
			this.Property(t => t.SendTimeType)
				.HasMaxLength(50);
				
			this.Property(t => t.SendArea)
				.HasMaxLength(50);
				
			this.Property(t => t.ReceiveBy)
				.HasMaxLength(50);
				
			this.Property(t => t.ReceiveAddress)
				.HasMaxLength(100);
				
			this.Property(t => t.ReceiveEmail)
				.HasMaxLength(100);
				
			this.Property(t => t.ReceiveTel)
				.HasMaxLength(30);
				
			this.Property(t => t.ReceiveMobile)
				.HasMaxLength(15);
				
			this.Property(t => t.ReceivePost)
				.HasMaxLength(15);
				
			this.Property(t => t.ReceiveFax)
				.HasMaxLength(30);
				
			this.Property(t => t.ReceiveProvince)
				.HasMaxLength(50);
				
			this.Property(t => t.ReceiveCity)
				.HasMaxLength(50);
				
			this.Property(t => t.ReceiveComment)
				.HasMaxLength(100);
				
			this.Property(t => t.ReceiveArea)
				.HasMaxLength(50);
				
			// Table & Column Mappings
			this.ToTable("WaybillTakeSendInfo");
			this.Property(t => t.WaybillTakeSendID).HasColumnName("WaybillTakeSendID");
			this.Property(t => t.WaybillNO).HasColumnName("WaybillNO");
			this.Property(t => t.SendBy).HasColumnName("SendBy");
			this.Property(t => t.SendAddress).HasColumnName("SendAddress");
			this.Property(t => t.SendPost).HasColumnName("SendPost");
			this.Property(t => t.SendTel).HasColumnName("SendTel");
			this.Property(t => t.SendEmail).HasColumnName("SendEmail");
			this.Property(t => t.SendMobile).HasColumnName("SendMobile");
			this.Property(t => t.SendFax).HasColumnName("SendFax");
			this.Property(t => t.SendProvince).HasColumnName("SendProvince");
			this.Property(t => t.SendCity).HasColumnName("SendCity");
			this.Property(t => t.SendTimeType).HasColumnName("SendTimeType");
			this.Property(t => t.SendGoodTime).HasColumnName("SendGoodTime");
			this.Property(t => t.SendArea).HasColumnName("SendArea");
			this.Property(t => t.ReceiveBy).HasColumnName("ReceiveBy");
			this.Property(t => t.ReceiveAddress).HasColumnName("ReceiveAddress");
			this.Property(t => t.ReceiveEmail).HasColumnName("ReceiveEmail");
			this.Property(t => t.ReceiveTel).HasColumnName("ReceiveTel");
			this.Property(t => t.ReceiveMobile).HasColumnName("ReceiveMobile");
			this.Property(t => t.ReceivePost).HasColumnName("ReceivePost");
			this.Property(t => t.ReceiveFax).HasColumnName("ReceiveFax");
			this.Property(t => t.ReceiveProvince).HasColumnName("ReceiveProvince");
			this.Property(t => t.ReceiveCity).HasColumnName("ReceiveCity");
			this.Property(t => t.ReceiveComment).HasColumnName("ReceiveComment");
			this.Property(t => t.ReceiveArea).HasColumnName("ReceiveArea");
			this.Property(t => t.IsDelete).HasColumnName("IsDelete");
			this.Property(t => t.IsCallBefore).HasColumnName("IsCallBefore");
		}
	}
}

